<?php
/*
 * Created on 01.02.2006
 *
 */

m2import('phpinchains/tags/c/includeHandler.php');

class conf_includeHandler extends c_includeHandler
{

    function startElement (& $sender, $attrs, $line)
    {
        if (!$attrs['file'])
        {
            die ("Attribute file is missing in include tag in line $line\n");
        }
        $code = '$confparts = explode(DIRECTORY_SEPARATOR, dirname(__FILE__));
                $file = explode("/", '.$attrs['file'].');
                while ($file[0] == \'..\')
                {
                    array_shift($file);
                    array_pop($confparts);
                }
                $conf = join("/", $confparts)."/".join("/", $file);
                PHPinChains :: compileConfigFile($conf);
                include($conf.".php");
                '."\n";
        $sender->appendCode($code);
    }
    
    function endElement (& $sender)
    {
    }

}

?>